#!/usr/bin/ruby
#
# jQTouch demo with Brightcove Media API
#
require 'rubygems'
require 'sinatra'
require 'net/http'
require 'haml'

require 'constants'

get '/' do
  haml :index
end

get '/playlists.json' do
  http = Net::HTTP.new('api.brightcove.com', 80)
  resp, data = http.get("/services/library?command=find_all_playlists&token=#{Constants::API_TOKEN}")
  data
end

